package com.hxci.hospital.service.impl;

import com.hxci.hospital.dao.DoctorMapper;
import com.hxci.hospital.pojo.Doctor;
import com.hxci.hospital.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DoctorServiceImpl implements DoctorService {

    @Autowired
    private DoctorMapper doctorMapper;

    @Override
    public int add(Doctor doctor) {
        return doctorMapper.add(doctor);
    }

    @Override
    public Doctor queryById(Integer id) {
        return doctorMapper.queryById(id);
    }

    @Override
    public Doctor queryByUsernameAndPassword(String username, String password) {
        return doctorMapper.queryByUsernameAndPassword(username, password);
    }

    @Override
    public List<Doctor> queryAll() {
        return doctorMapper.queryAll();
    }

    @Override
    public List<Doctor> queryByDepartment(String department) {
        return doctorMapper.queryByDepartment(department);
    }
    
    @Override
    public List<Doctor> queryByDepartmentAndRole(String department, String role) {
        return doctorMapper.queryByDepartmentAndRole(department, role);
    }

    @Override
    public int update(Doctor doctor) {
        return doctorMapper.update(doctor);
    }
}
